package com.lxp.design.shop.order.kafka.receivers;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author LaiXiaoPeng
 * @version 1.0
 * @date 2022/9/14 16:22
 */
@Component
@Slf4j
public class KafkaMessageListener {

    @KafkaListener(topics = "${spring.kafka.topic.test}")
    public void onMessage(ConsumerRecord<String,Object> msg){
        log.info("消费者接收到的消息：{}",msg.toString());
    }
}
